const utilsPlus = require("../../dist/index");


const tree = [
  {
    id: 1,
    name: '根节点',
    children: [
      {
        id: 2,
        name: '技术部',
        children: [
          {
            id: 4,
            name: '前端组',
            children: [
              { id: 8, name: 'Vue开发', checked: true },
              { id: 9, name: 'React开发', checked: false },
            ],
          },
          {
            id: 5,
            name: '后端组',
            children: [
              { id: 10, name: 'Java开发', checked: true },
              { id: 11, name: 'Go开发', checked: true },
            ],
          },
        ],
      },
      {
        id: 3,
        name: '市场部',
        children: [
          {
            id: 6,
            name: '推广组',
            children: [
              { id: 12, name: 'SEO优化', checked: true },
              { id: 13, name: 'SEM投放', checked: false },
            ],
          },
          {
            id: 7,
            name: '品牌组',
            children: [
              { id: 14, name: '品牌策划', checked: false },
              { id: 15, name: '公关传播', checked: false },
            ],
          },
        ],
      },
    ],
  },
];


// utilsPlus.updateCheckState(tree, true)
// console.log(JSON.stringify(tree));
console.log(JSON.stringify(utilsPlus.getTreeChecked(tree)));
